package com.mercury.emqx.client;
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//


import com.github.lianjiatech.retrofit.spring.boot.annotation.RetrofitClient;
import com.mercury.emqx.client.annotation.MqttAuthorization;
import com.mercury.emqx.client.req.MqttPublishReq;
import com.mercury.emqx.client.req.MqttSubscribeReq;
import com.mercury.emqx.client.resp.MqttResp;
import retrofit2.http.Body;
import retrofit2.http.POST;
import retrofit2.http.Url;


/**
 * http客户端
 *
 * @author mercury
 */
@RetrofitClient(
        baseUrl = "https://baidu.com",
        connectTimeoutMs = 5000,
        readTimeoutMs = 5000,
        writeTimeoutMs = 5000
)
@MqttAuthorization(
        appId = "${spring.mqtt.app-id:xxx}",
        appSecret = "${spring.mqtt.app-secret:xxx}"
)
public interface MqttClient {

    String PUBLISH = "/api/v4/mqtt/publish";
    String SUBSCRIBE = "/api/v4/mqtt/subscribe";

    /**
     * 发布
     *
     * @param url            地址
     * @param payloadMessage 消息内容
     * @return rep
     */
    @POST
    MqttResp<Object> publish(@Url String url, @Body MqttPublishReq payloadMessage);


    /**
     * 订阅
     *
     * @param url              地址
     * @param mqttSubscribeReq 消息内容
     * @return rep
     */
    @POST
    MqttResp<Object> subscribe(@Url String url, @Body MqttSubscribeReq mqttSubscribeReq);

}


